Carbon


ReleaseFolder

Header: Folders.h Carbon status: Supported

Releases the Trash folder in preparation for unmounting a server volume.

OSErr ReleaseFolder (
    SInt16 vRefNum, 
    OSType folderType
);
Parameter descriptions
vRefNum

Pass the volume reference number of the server volume on which you want to release the Trash folder.

folderType

Always pass the kTrashFolderType constant. Other folder types are currently ignored.

function result

A result code.

DISCUSSION

When you call FindFolder with the kTrashFolderType constant, it opens a file on a server volume that ensures each server volume user gets a unique Trash folder. Because a server volume’s Trash folder may contain files or folders put there by the user, applications should delete the contents of the server volume’s Trash folder. To do this, before your application unmounts a server volume, your application should call ReleaseFolder, or the UnmountVol request could fail with a fBsyErr result code. ReleaseFolder closes the file FindFolder may have opened and releases the Trash folder on that volume.

Your application should not use this function unless you want to unmount one or more server volumes. Normally, applications should not unmount servers; they should let users use the Finder to unmount volumes. In particular, applications should have no need to release the Trash folder explicitly; rather, unmounting volumes should be left to users to do with the Finder or by restarting.

VERSION NOTES

This function is available under System 7.1 and later.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)